namespace Declaratie.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Projects",
                c => new
                    {
                        ProjectId = c.Int(nullable: false, identity: true),
                        Nr = c.Int(nullable: false),
                        Titel = c.String(),
                        Soort = c.String(),
                        LoopTijdBegin = c.DateTime(nullable: false),
                        LoopTijdEind = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.ProjectId);
            
            CreateTable(
                "dbo.Activiteits",
                c => new
                    {
                        ActiviteitId = c.Int(nullable: false, identity: true),
                        Nr = c.Int(nullable: false),
                        Name = c.String(),
                        Project_ProjectId = c.Int(),
                        Medewerker_Medewerkerid = c.Int(),
                    })
                .PrimaryKey(t => t.ActiviteitId)
                .ForeignKey("dbo.Projects", t => t.Project_ProjectId)
                .ForeignKey("dbo.Medewerkers", t => t.Medewerker_Medewerkerid)
                .Index(t => t.Project_ProjectId)
                .Index(t => t.Medewerker_Medewerkerid);
            
            CreateTable(
                "dbo.ConsortiumPartners",
                c => new
                    {
                        ConsortiumPartnerId = c.Int(nullable: false, identity: true),
                        Naam = c.String(),
                        Straat = c.String(),
                        Nr = c.String(),
                        Toevoeging = c.String(),
                        Postcode = c.String(),
                        Banknummer = c.String(),
                        Bic = c.String(),
                        Iban = c.String(),
                        Email = c.String(),
                        PersentageCoFinanciering = c.String(),
                        Wachtwoord = c.String(),
                        Project_ProjectId = c.Int(),
                    })
                .PrimaryKey(t => t.ConsortiumPartnerId)
                .ForeignKey("dbo.Projects", t => t.Project_ProjectId)
                .Index(t => t.Project_ProjectId);
            
            CreateTable(
                "dbo.Medewerkers",
                c => new
                    {
                        Medewerkerid = c.Int(nullable: false, identity: true),
                        Voornaam = c.String(),
                        Achternaam = c.String(),
                        Telefoonnummer = c.String(),
                        ConsortiumPartner_ConsortiumPartnerId = c.Int(),
                    })
                .PrimaryKey(t => t.Medewerkerid)
                .ForeignKey("dbo.ConsortiumPartners", t => t.ConsortiumPartner_ConsortiumPartnerId)
                .Index(t => t.ConsortiumPartner_ConsortiumPartnerId);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.Medewerkers", new[] { "ConsortiumPartner_ConsortiumPartnerId" });
            DropIndex("dbo.ConsortiumPartners", new[] { "Project_ProjectId" });
            DropIndex("dbo.Activiteits", new[] { "Medewerker_Medewerkerid" });
            DropIndex("dbo.Activiteits", new[] { "Project_ProjectId" });
            DropForeignKey("dbo.Medewerkers", "ConsortiumPartner_ConsortiumPartnerId", "dbo.ConsortiumPartners");
            DropForeignKey("dbo.ConsortiumPartners", "Project_ProjectId", "dbo.Projects");
            DropForeignKey("dbo.Activiteits", "Medewerker_Medewerkerid", "dbo.Medewerkers");
            DropForeignKey("dbo.Activiteits", "Project_ProjectId", "dbo.Projects");
            DropTable("dbo.Medewerkers");
            DropTable("dbo.ConsortiumPartners");
            DropTable("dbo.Activiteits");
            DropTable("dbo.Projects");
        }
    }
}
